package com.xiaomazi.edu.controller.front;

import com.xiaomazi.common.utils.R;
import com.xiaomazi.edu.dto.TeacherQuery;
import com.xiaomazi.edu.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: llxy-parent
 * @description: 讲师前端控制器
 * @author: 小马子
 * @create: 2023-03-01 15:51
 **/
@RestController
@RequestMapping("/eduservice/teacherFront")
public class TeacherFrontController {


    @Autowired
    private TeacherService teacherService;

    @PostMapping("/getAllTeacher")
    public R getAllTeacher(@RequestBody TeacherQuery teacherQuery){
        return teacherService.pageListTeacherByQuery(teacherQuery);
    }

    @GetMapping("/getTeacherInfoById/{teacherId}")
    public R getTeacherInfoById(@PathVariable String teacherId){
        return teacherService.getTeacherInfoById(teacherId);
    }


}
